/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package severdorhttpsimples;

/**
 *
 * @author Alisson
 */

import java.io.*;
import java.net.*;
class ClienteTCP {

    public static void main(String argv[]) throws Exception
    {
        String frase;
        String fraseModificada;

        BufferedReader doUsuario =
          new BufferedReader(new InputStreamReader(System.in));

        Socket socketCliente = new Socket("nomeHosp", 6789);

        DataOutputStream paraServidor =
          new DataOutputStream(socketCliente.getOutputStream());
        BufferedReader doServidor = new BufferedReader(new InputStreamReader(socketCliente.getInputStream()));

        frase = doUsuario.readLine();

        paraServidor.writeBytes(frase + '\n');

        fraseModificada = doServidor.readLine();

        System.out.println("Do Servidor: " + fraseModificada);

        socketCliente.close();

    }
}
